<script type="text/javascript">
	function KiemTraDangNhap()
	{
		var us  = document.getElementById("us");
		var ps = document.getElementById("ps");
		
		if(us.value == "")
		{
			alert("Nhập tên đăng nhập");
			us.focus();
			return false;	
		}
		
		if(ps.value == "")
		{
			alert("Nhập mật khẩu");
			ps.focus();
			return false;	
		}
		
		return true;
	}
</script>
<div id="navHeader">
<div id="top">
<table align="right">
  		<tr>
        	<td>
            <?php
				$_SESSION["urlHienTai"] = $_SERVER['REQUEST_URI'];
				if(!isset($_SESSION["manguoidung"]))
				{
					?>
                    <td>
            			<form name="frmDangNHap" action="./pages/xlDangNhap.php" method="post" onsubmit="return KiemTraDangNhap()">
                            Tên đăng nhâp: <input type="text" name="us" id="us" />
                            Mật khẩu: <input type="password" name="ps" id="ps" />
                            <input type="submit" value="Đăng nhập" />	
                        </form>        
                    </td>            
		            <td><a href ="index.php?act=7"><font color="#000099">|Đăng ký|&nbsp;</font></a></td>
                    <?php	
				}
				else
				{
					$ten = $_SESSION["tennguoidung"];
					echo $ten;
					?>
                    <td>
                    	<form name="frmDangNHap" action="./pages/xlDangXuat.php" method="post">
                            <input type="submit" value="Đăng xuất" />	
                        </form>
                    </td>
                    <td align="center">
                    	<a href ="index.php?act=14"> | <img src="./images/Layout/giohang.png" width="20" /> 
                    		<?php
                            	if(isset($_SESSION["giohang"]))
									echo count($_SESSION["giohang"]);
								else
									echo 0;
								echo " sản phẩm";
							?>
                    	</a>
                    </td>
                    <?php	
				}
			?>
            </td>
        </tr>
  </table>
</div>
<div id="bottom"></div>
 <div id="menu">
    <table>
    <tr>
    <td>
    <span class="menuoption"><a href="index.php"><font color="#FFFFFF">Trang Chủ</font></a></span>
    <span class="boder_right"></span>
    <span class="menuoption"><a href="index.php?act=8"><font color="#FFFFFF">Giới Thiệu</font></a></span>
    <span class="boder_right"></span>
    <span class="menuoption"><a href="index.php?act=9"><font color="#FFFFFF">Sản Phẩm</font></a></span>
    <span class="boder_right"></span>
    <span class="menuoption"><a href="index.php?act=11"><font color="#FFFFFF">Tin Tức</font></a></span>
    <span class="boder_right"></span>
    <span class="menuoption"><a href="index.php?act=10"><font color="#FFFFFF">Liên Hệ</font></a></span>
    <span class="boder_right"></span>
    <span class="menuoption"><a href="index.php?act=12"><font color="#FFFFFF">Khuyến Mãi</font></a></span>
    </tr>
    </table>
    </div>
</div>


